/*
 * LevelEditorWindow.h
 *
 *  Created on: 22/06/2014
 *      Author: javier
 */

#ifndef LEVELEDITORWINDOW_H_
#define LEVELEDITORWINDOW_H_

#include <gtkmm.h>
#include "Campania.h"
#include "EditorController.h"
#include "Properties.h"
#include <map>
#include <utility>
#include "TileButton.h"

class CampaignEditorWindow;

class LevelEditorWindow: public Gtk::Window {
public:
	LevelEditorWindow(BaseObjectType* cobject,
			const Glib::RefPtr<Gtk::Builder>& refGlade);
	virtual ~LevelEditorWindow();
	const CampaignEditorWindow* getCampaignWindow() const;
	void setCampaignWindow( CampaignEditorWindow* campaignWindow);

	void addSpawnZombie();
	void addSpawnBomberman();
	void addBox();
	void addMetal();
	void addPlant();

	void back();
	void setCampania( Campania* camp);
	void setLevel( Nivel* level);
	void setController( EditorController* controller);

	void selectTile(TileButton* btnSelected, int x, int y);
private:
	Gtk::Button* btnBox;
	Gtk::Button* btnMetal;
	Gtk::Button* btnPlant;
	Gtk::Button* btnSpawnBomberman;
	Gtk::Button* btnSpawnZombie;
	Gtk::Button* btnBack;

	TileButton* btnSelected;

	Gtk::Grid *gridLevel;

	Gtk::Entry *inputEnemies, *inputID;

	EditorController* controller;

	Properties properties;

	CampaignEditorWindow* campaignWindow;
	Campania * camp;
	Nivel* level;

	std::map<std::pair<int, int>, TileButton*> buttons;

	int idSequence;
};

#endif /* LEVELEDITORWINDOW_H_ */
